import React, {Component} from 'react';
import {
    StyleSheet,
    Text,
    View,
    Image,
    ScrollView,
    ImageBackground,
} from 'react-native';
import {Button, WhiteSpace, WingBlank, Flex} from '@ant-design/react-native';

class SignSuccess extends Component {
    // 配置页面导航选项
    static navigationOptions = ({navigation}) => ({
        title: 'HOME',
        titleStyle: {color: '#FFFFFF'},
        headerTransparent: true,
    });

    constructor(props) {
        //调用基类的所有的初始化方法
        super(props);

        // 设置当前组件的属性
        this.state = {};
    } //
    render() {
        return (
            <View style={styles.container}>
                <ImageBackground
                    style={styles.image}
                    source={require('~/assets/login/buttom12x.png')}
                />
                <View
                    style={{
                        flex: 1,
                        justifyContent: 'center',
                        alignItems: 'center',
                    }}>
                    <View style={styles.view}>
                        <Flex direction={'column'} justify={'center'}>
                            <Image
                                style={styles.imagessuccess}
                                source={require('~/assets/login/success2x.png')}
                            />
                            <Text style={styles.fltext}>注册成功！</Text>
                            <Text style={styles.fltext2}>
                                恭喜你，成功注册，快去使用吧！
                            </Text>
                            <Flex direction={'row'} justify={'around'}>
                                <Flex
                                    justify={'center'}
                                    style={styles.button}
                                    onPress={() => {
                                        this.props.navigation.push(
                                            'Information',
                                            {
                                                index: 1,
                                            },
                                        );
                                    }}>
                                    <Text style={styles.butext}>领取礼品</Text>
                                </Flex>
                                <Flex
                                    justify={'center'}
                                    onPress={() => {
                                        this.props.navigation.navigate(
                                            'NavigatorTab',
                                        );
                                    }}
                                    style={styles.button1}>
                                    <Text style={styles.butext}>进入首页</Text>
                                </Flex>
                            </Flex>
                        </Flex>
                    </View>
                </View>
            </View>
        );
    }
}

export default SignSuccess;
const styles = StyleSheet.create({
    container: {
        width: '100%',
        height: '35%',
        flexDirection: 'column',
    },
    image: {
        flex: 1,
        height: 220,
        resizeMode: 'repeat',
        justifyContent: 'center',
    },
    view: {
        width: 277,
        height: 330,
        marginTop: 280,
        borderRadius: 15,
        backgroundColor: 'white',
    },
    imagessuccess: {
        marginTop: 37,
        width: 103,
        height: 107,
    },
    fltext: {
        color: '#333333',
        fontSize: 18,
        marginTop: 30,
        fontWeight: 'bold',
    },
    fltext2: {
        color: '#999999',
        fontSize: 15,
        marginTop: 21,
    },
    button: {
        width: 105,
        height: 35,
        borderRadius: 2.5,
        marginTop: 23,
        fontSize: 14,
        backgroundColor: '#F2BC38',
    },
    button1: {
        width: 105,
        height: 35,
        borderRadius: 2.5,
        marginTop: 23,
        marginLeft: 8,
        fontSize: 14,
        backgroundColor: '#EC4F46',
    },
    butext: {
        color: '#FFFFFF',
    },
});
